Overview
Every PVAC-HFHE workflow follows these steps:1
Generate keys
Create public and secret keys using the
keygen function2
Encrypt data
Convert plaintext values to ciphertexts using
enc_value3
Perform operations
Execute homomorphic operations on encrypted data
4
Decrypt results
Recover plaintext values using
dec_valueSetting up the cryptographic context
Every PVAC-HFHE application starts by generating cryptographic keys:The
keygen function takes approximately 859ms according to benchmark data. This is a one-time operation per session.Encrypting values
Useenc_value to encrypt 64-bit unsigned integers:
Example from source
Fromexamples/basic_usage.cpp:59-63:
Decrypting values
Thedec_value function returns a field element Fp with two components:
Testing encryption correctness
Verify your encryption pipeline with special values:examples/basic_usage.cpp:66-70:
Performance characteristics
Based on benchmark data:Verifying randomness
Encryptions of the same value produce different ciphertexts due to randomization:examples/basic_usage.cpp:216-221:
Next steps
Key generation
Deep dive into parameters and key structures
Arithmetic operations
Learn ct_add, ct_mul, and ct_sub